package com.highper.common.configuration;

import com.highper.common.interceptor.ServerProtectInterceptor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Author ZhangGJ
 * @Date 2022/01/27 16:05
 */
public class ServerProtectConfigure implements WebMvcConfigurer {

    @Value("${spring.application.name}")
    private String serviceName;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new ServerProtectInterceptor(serviceName));
    }
}
